package rs.frenjoynet.core.core.db;

import common.db.id.Identified;

import java.util.List;

import org.hibernate.SessionFactory;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 23.10.2009.
 * Time: 12.51.05
 * To change this template use File | Settings | File Templates.
 */
public interface DBBroker
{
	public <T> Object insert(Class<T> clazz, Object entity);

	public <T> Object update(Class<T> clazz, Object entity);

	public <T> Object update(Class<T> clazz, String sql, Object... ids);

	public int delete(String sql, Object...ids);

	public <T> List query(Class<T> clazz, String sql, Object... ids);

	public <T> Object queryOne(Class<T> clazz, String sql, Object... ids);

	public <T> List query(Class<T> clazz, int first, Integer rowCount, String sql, Object... ids);

	public <T> List pageQuery(Class<T> clazz, int page, int pageSize, String sql, Object... ids);

	 SessionFactory getSessionFactory();

}
